package com.example.pharmacy.model;

import com.example.pharmacy.commen.Constant;
import lombok.Data;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: asus
 * Date: 2024-12-21
 * Time: 15:36
 */
@Data
public class Result {
    private int code;
    private String msg;
    private Object data;
    public static Result success(Object data) {
        Result result = new Result();
        result.setCode(Constant.RESULT_CODE_SUCCESS);
        result.setMsg("");
        result.setData(data);
        return result;
    }
    public static Result fail(String msg) {
        Result result = new Result();
        result.setCode(Constant.RESULT_CODE_FAIL);
        result.setMsg(msg);
        result.setData(null);
        return result;
    }
}
